export function base64ToFile(base64: string, fileName: string): string {
    // 去除头部信息
    const arr = base64.split(',');
    const mime = arr[0].match(/:(.*?);/)?.[1] || '';
    const bstr = atob(arr[1]);
    const n = bstr.length;
    const u8arr = new Uint8Array(n);

    // 转换 Base64 字符串为字节数组
    for (let i = 0; i < n; i++) {
        u8arr[i] = bstr.charCodeAt(i);
    }

    // 创建 Blob 对象
    const blob = new Blob([u8arr], { type: mime });

    // 生成文件 URL
    return URL.createObjectURL(blob);
}